New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat, UX] Add multiswipe recorder #4644
Conversation
Frenzie
commented
Feb 22, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, lgtm.
(may be remove the blank lines 95 & 97)
Silly oversight in koreader#4644.
Silly oversight in #4644. Also remove unused util because apparently CircleCI didn't run on the other PR when it should've.
Obligatory Konami code reference. :D |
Haha, it does look a bit like it! :D |
(Many multiswipe PRs, don't really know where to put my comments :) so putting them in the related PR even if one single place would may be better). When recording/adding a new gesture, one needs to restart koreader to see it in the menu and be able to assign some action to it. |
It's easy enough to work around, but I was hoping there was something more proper in place, see #4651. diff --git a/frontend/apps/reader/modules/readergesture.lua b/frontend/apps/reader/modules/readergesture.lua
index 45f75eff..a180b776 100644
--- a/frontend/apps/reader/modules/readergesture.lua
+++ b/frontend/apps/reader/modules/readergesture.lua
@@ -55,6 +55,15 @@ function ReaderGesture:initGesture()
G_reader_settings:saveSetting(self.ges_mode, gesture_manager)
end
+function ReaderGesture:genMultiswipeSubmenu()
+ return {
+ text = _("Multiswipe"),
+ sub_item_table = self:buildMultiswipeMenu(),
+ enabled_func = function() return self.multiswipes_enabled end,
+ separator = true,
+ }
+end
+
function ReaderGesture:addToMainMenu(menu_items)
menu_items.gesture = {
text = _("Gesture manager"),
@@ -71,7 +80,7 @@ function ReaderGesture:addToMainMenu(menu_items)
{
text = _("Multiswipe recorder"),
enabled_func = function() return self.multiswipes_enabled end,
- callback = function()
+ callback = function(touchmenu_instance)
local multiswipe_recorder
multiswipe_recorder = InputDialog:new{
title = _("Multiswipe recorder"),
@@ -92,6 +101,8 @@ function ReaderGesture:addToMainMenu(menu_items)
if not recorded_multiswipe then return end
logger.dbg("Multiswipe recorder detected:", recorded_multiswipe)
custom_multiswipes:addTableItem("multiswipes", recorded_multiswipe)
+ -- TODO implement some nicer method in TouchMenu than this ugly hack for updating the menu
+ touchmenu_instance.item_table[3] = self:genMultiswipeSubmenu()
UIManager:close(multiswipe_recorder)
end,
},
I think just opening a new issue would be easier to keep track of. :-) |
Also extend the default set of gestures to include all of them, and add east south west north for refresh. (I've always thought small diagonal swipe to be rather awkward to trigger.) See koreader#4644 (comment) and koreader#4651 regarding the menu update.
Include a safety check to prevent rerecording an existing gesture. Also extend the default set of gestures to include all of them, and add east south west north for refresh. (I've always thought small diagonal swipe to be rather awkward to trigger.) See koreader#4644 (comment) and koreader#4651 regarding the menu update.
Include a safety check to prevent rerecording an existing gesture. Also extend the default set of gestures to include all of them, and add east south west north for refresh. (I've always thought small diagonal swipe to be rather awkward to trigger.) See #4644 (comment) and #4651 regarding the menu update.
Silly oversight in koreader#4644. Also remove unused util because apparently CircleCI didn't run on the other PR when it should've.
…r#4652) Include a safety check to prevent rerecording an existing gesture. Also extend the default set of gestures to include all of them, and add east south west north for refresh. (I've always thought small diagonal swipe to be rather awkward to trigger.) See koreader#4644 (comment) and koreader#4651 regarding the menu update.